package com.cloud.business.service.sys;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cloud.business.entity.sys.SysStruct;
import com.cloud.business.model.commonvm.DataTree;
import com.cloud.business.model.commonvm.DeletePost;
import com.cloud.business.model.commonvm.ResultMsg;
import com.cloud.business.model.sys.sysstructvm.SysStructQueryModel;
import com.cloud.business.model.sys.sysstructvm.SysStructTree;

import java.util.List;

/**
 * <p>
 * 系统组织架构 服务类
 * </p>
 *
 * @author dh
 * @since 2020-03-21
 */
public interface ISysStructService {

    /**
     * 分页列表
     *
     * @param sysStructQueryModel
     * @param page
     * @param msg
     * @throws Exception
     */
    void getListByPage(SysStructQueryModel sysStructQueryModel, IPage<SysStruct> page, ResultMsg msg) throws Exception;

    /**
     * 创建
     *
     * @param sysStruct
     * @return
     * @throws Exception
     */
    Integer create(SysStruct sysStruct, ResultMsg msg) throws Exception;

    /**
     * 更新
     *
     * @param sysStruct
     * @return
     * @throws Exception
     */
    Integer update(SysStruct sysStruct, ResultMsg msg) throws Exception;

    /**
     * 获取单条
     *
     * @param operationId
     * @param objectId
     * @return
     * @throws Exception
     */
    SysStruct getById(Integer operationId, Integer objectId, ResultMsg msg) throws Exception;

    /**
     * 批量删除
     *
     * @param deletePost
     * @return
     * @throws Exception
     */
    int deleteByList(DeletePost deletePost, ResultMsg msg) throws Exception;

    /**
     * 获取部门树
     *
     * @param operationId
     * @param pkSysStruct
     * @return
     */
    List<SysStructTree> getSysStructsTree(Integer operationId, Integer pkSysStruct, Boolean isEnable);

    /**
     * 获取部门树下人员
     *
     * @param operationId
     * @param pkSysStruct
     * @return
     */
    List<DataTree> getStructUserTree(Integer operationId, Integer pkSysStruct);
}
